import { defineStore } from "pinia";

export const userStore = defineStore({
    id: "user",
    state: () => ({
        userInfo: {},
        userGetPush: [],
    }),
    getters: {},
    actions: {
        userInfoChange(data) {
            this.userInfo = data;
            console.log(this.userInfo);
        },
    },
    // 开启数据缓存
    persist: {
        enabled: true,
        strategies: [
            {
                key: "my_user",
                storage: localStorage,
            },
        ],
    },
});
